public class checkAccountCreatPermission {

    public checkAccountCreatPermission(ApexPages.StandardController controller) {

    }

    
    public PageReference autorun(){
    
        PageReference returnPage= new PageReference('/001/e'); //create page reference appropriately using Action (New) and remember to pass back any parametrs passed to this page
        returnPage.setRedirect(true);
                   
        Profile p = [Select Name from Profile where Id = :userInfo.getProfileId()];
        
                                
        if(p.Name=='System Administrator'){ //this is just a quick test - needs to work off of user profile
            System.debug('******Going to Account Page*****');
            return returnPage;
        }
        else{
         System.debug('*********Error Page********');
         return null;
        }
    }
    
}